<template>
  <div class="withdraw">
    <div class="page-head" @click="goBack">
      <div class="back-content">
        <span class="icon iconfont back">&#xe6dc;</span>
      </div>
      <div class="page-head-title">Withdraw</div>
    </div>
    <div class="page-head-sub"></div>
    <div class="form-content">
      <div class="price-row">
        <van-field
          label="$"
          type="number"
          input-align="left"
          placeholder="Withdrawal amount"
          v-model="withdrawAmount"
        />
        <div class="price-tip">
          Withdrawable amount:<span class="all-price">$0.00</span>
        </div>
      </div>
      <!-- <div class="input-row" v-show="!(withdrawAmount >= 10000)">
        <div class="box">
          <div class="input_data">
            <input type="text" required />
            <label>PayPal account</label>
          </div>
        </div>
      </div> -->
      <myInput  v-show="!(withdrawAmount >= 10000)" :title="'PayPal account'"/>
      

      <div v-show="withdrawAmount >= 10000">
        <!-- <div class="input-row" v-for="(item, index) in bankOpts" :key="index">
          <div class="box">
            <div class="input_data">
              <input type="text" required />
              <label>{{ item.field }}</label>
            </div>
          </div>
        </div> -->
        <myInput  :title="item.field" v-for="(item, index) in bankOpts" :key="index" />
      </div>

      <div class="submit-btn" @click="submit">SUBMIT</div>
      <van-dialog v-model="show" title="Tips" >
  <div class="content">
    Please enter the withdrawal amount
  </div>
</van-dialog>
    </div>
  </div>
</template>

<script>
import { Dialog } from "vant";
import myInput from "@/components/input";

export default {
  name: "withdraw",
  data() {
    return {
      show:false,
      withdrawAmount: undefined,
      bankOpts: [
        {
          field: "Name of payees",
        },
        {
          field: "Receiving bank account",
        },
        {
          field: "Routing Code",
        },
        {
          field: "SWIFT Code",
        },
        {
          field: "Recipient bank",
        },
        {
          field: "Bank address",
        },
      ],
      form: {
        name: "",
        banckAccount: "",
        routingCode: "",
        swiftCode: "",
        repBank: "",
        bankAddr: "",
      },
    };
  },
  components:{
    myInput
  },
  methods: {
    goBack() {
      this.$router.go(-1);
    },
    submit() {
      this.show = true
      // Dialog.alert({
      //   title: "Tips",
      //   message: "Withdrawal amount error",
      // }).then(() => {
      //   // on close
      // });
    },
  },
};
</script>

<style lang="scss" scoped>
.withdraw {
  color: var(--text-color);
  box-sizing: border-box;
  .page-head {
    padding-top: calc(0px);
    height: 50px;
    background: var(--content-bc);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-left: 0;
    padding-right: 40px;
    font-size: 14px;
    font-weight: 400;
    color: var(text-color);
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9;
    .back-content {
      width: 40px;
      height: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
      .back {
        font-size: 22px;
      }
    }
    .page-head-title {
      font-size: 16px;
      font-weight: 500;
      margin: auto;
    }
  }
  .page-head-sub {
    width: 100%;
    height: 50px;
    padding-top: calc(0px);
  }
  .form-content {
    width: 100%;
    background-color: var(--content-bc);
    padding: 20px 12px;
    margin-top: 15px;
    box-sizing: border-box;
    .price-row {
      padding: 10px 0;
      .price-tip {
        font-size: 14px;
        padding: 5px 0;
        color: #999;
        .all-price {
          color: #f44;
          margin-left: 5px;
          font-size: 18px;
        }
      }
    }
    .input-row {
      width: 100%;
      height: 44px;
      border: 1px solid #999;
      border-radius: 6px;
      margin-bottom: 10px;
      position: relative;
      transition: 0.3s;
    }
    .input-row:hover {
      width: 100%;
      height: 44px;
      border: 1px solid var(--text-color);
      border-radius: 6px;
      margin-bottom: 10px;
      position: relative;
      transition: 0.3s;
    }
    .submit-btn {
      width: 100%;
      height: 44px;
      border-radius: 6px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 16px;
      color: #fff;
      margin-top: 30px;
      background: linear-gradient(98deg, #f48836, #f4364c 100%);
    }
  }
}
</style>


.<style lang="scss">
.withdraw {
  .van-dialog {
    background: var(--content-bc) ;
    color: var(--text-color) ;
    .content {
      text-align: center;
    /* width: 131px; */
    margin: o auto;
    margin: 0 auto;
    }
  }
  .van-dialog__confirm, .van-dialog__confirm:active {
    background: var(--content-bc) ;
    color: var(--text-color) ;
}
  .box {
    // width: 450px;
    background: #fff;
    // padding: 30px;
    // box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 0 0 0 5px;
    background: var(--conten-bc);
  }

  .box .input_data {
    height: 30px;
    width: 100%;
    position: relative;
    margin-top: 10px;
  }

  .box .input_data input {
    display: block;
    height: 100%;
    width: 100%;
    border: none;
    // font-size: 16px;
    // border-bottom: 2px solid silver;
    background: var(--content-bc);
    color: var(--text-color);
    font-size: 12px;
  }

  .input_data input:focus,
  .input_data input:valid {
    outline: 0;
    // border-bottom-color: #4158d0;
  }

  .input_data input:focus ~ label,
  .input_data input:valid ~ label {
    transform: translateY(-12px);
    font-size: 12px;
    color: grey;
  }

  .box .input_data label {
    position: absolute;
    bottom: 10px;
    left: 0;
    color: grey;
    pointer-events: none;
    transition: all 0.3s ease;
  }

  .vs-input {
    margin: 5px;
    margin-top: 20px;
  }
  .van-cell {
    background: var(--content-bc);
    border-bottom: 1px solid hsla(0, 0%, 50.2%, 0.8);
  }
  .van-field__label {
    color: var(--text-color);
    font-size: 22px;
    width: 20px;
  }
  .van-field__control {
    color: var(--text-color);
    font-size: 27px;
  }
  .van-field__control::-webkit-input-placeholder {
    /* WebKit browsers */
    color: #999;
  }
}
</style>